{% if has_polls %}
  {% for poll, likes, views, voted in polls %}
    <div id="{{poll.id}}" class="card poll">
      {% if poll.image %}
        <div class="poll-bg" style="background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(210, 217, 223, 0.96) 61%), url({{ poll.image.url }});"></div>
      {% else %}
        <div class="poll-bg" style="background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(210, 217, 223, 0.96) 61%), url();"></div>
      {% endif %}
      <div class="actions-btn"></div>
      <div class="card-body poll-body">
        <div class="card-head">
          <p class="card-title vote-title">{{poll.name}}</p>
          <p class="card-text poll_description">{{poll.description}}</p>
        </div>
        {% if voted %}
          {% for i, res in voted.items %}
            {{res}}
          {% endfor %}
        {% else %}
          {% for vote in poll.votevariant_set.all %}
            <div id="{{vote.id}}" class="btn btn-primary vote" onclick="vote()">{{vote.name}}</div>
          {% endfor %}
        {% endif %}
        <div class="card-bottom">
          <p class="created-by align-self-start">Created by: <span class="author">{{poll.author}}</span></p>
          <div class="stat align-self-center">
            <p>{{likes}}</p>
            {% csrf_token %}
            <button class="btn vote-icon stat-icon" onclick="like({{poll.id}})"></button>
          </div>
          <div class="stat align-self-center">
            <p>{{views}}</p>
            <div class="view-icon stat-icon"></div>
          </div>
          <button type="button" class="btn btn-info report align-self-end" onclick="show_report_creation({{poll.id}})">Report</button>
        </div>
      </div>
    </div>
  {% endfor %}

{% else %}
  <div class="card">
    <div class="card-body">
      <h2>Не получилось достать опросы :(</h2>
    </div>
  </div>
{% endif %}